import Cookies from 'js-cookie'

const TokenKey = 'minhaireal_token';
const AccountKey = 'minhaireal_account';

export function getToken() {
  var tk =  window.localStorage.getItem(TokenKey)||"";
  return tk;
}

export function setToken(token) {
  return window.localStorage.setItem(TokenKey, token)
}

export function removeToken() {
  return window.localStorage.setItem(TokenKey,'')
}
export function getAccount() {
    var at =  window.sessionStorage.getItem(AccountKey)||"";
    if(at)
    {
        typeof at == 'string' && (at = JSON.parse(at));
    }
    return at;
}

export function setAccount(Account) {
return window.sessionStorage.setItem(AccountKey, Account)
}

export function removeAccount() {
return window.sessionStorage.setItem(AccountKey,'')
}